HackerTrans
TopNewTrendsCommentsPastAskShowJobs

randomwebdev

no profile record

comments

randomwebdev
·anno scorso·discuss
> As to 4x, my concurrency levels are significantly lower which could certainly explain it.

Yes I noticed that too so that it is very likely the reason.

In all cases my initial comment wasn't intended to "dispute", argue or anything like that, so please don't feel obligated to waste time updating the benchmarks. They are valid as they are!

My initial comment was more of a note/suggestion to simply list the used versions of the tested platforms (not just for PocketBase) because often they change over time and the shown results could be misleading if someone stumble on the article 2 years later for example.
randomwebdev
·anno scorso·discuss
> I'm not sure this is expected but it didn't seem to make much of a difference with my setup

I expect it to be faster but it is also possible that maybe in your specific collection and execution scenario it somehow perform worst, or at least not the same as in my benchmarks, I'm not sure.

The ~4x mentioned speed up is based on the tests for Hetzner CAX41 with the CGO driver when creating 50k records with 500 concurrent clients:

Old (58.409064001s): https://github.com/pocketbase/benchmarks/blob/54140be5fb0102...

New (13.580098262s): https://github.com/pocketbase/benchmarks/blob/7df0466ac9bd62...

---

Edit: Based on your benchmarks repo (https://github.com/trailbaseio/trailbase-benchmark/tree/main...) note that compiling PocketBase with `CGO_ENABLED=1` is no longer enough to kick in the github.com/mattn/go-sqlite3 driver and you need to enable it manually as shown in the db_cgo.go in our benchmarks OR like in https://pocketbase.io/docs/go-overview/#github-commattngo-sq... (the reason for this change was to avoid the "multiple definition" linker errors).
randomwebdev
·anno scorso·discuss
(Disclaimer: I'm PocketBase author)

It is nice to see more backends utilizing SQLite. The benchmarks and the Comparisions section also seem well done.

Just a nitpick - list the versions of the tested platforms.

Based on your benchmarks repo it looks like that the tests were done against PocketBase < v0.23 but note that PocketBase v0.23+ (especially with the Create API rule dry submit removal in v0.24+) has introduced significant changes and performance improvements - ~4x times in high concurrent scenarios in our own benchmarks[0] (if you want to retest it note that the CGO driver is no longer loaded by default and will have to be registered manually; see the example "db_cgo.go" in the PocketBase benchmarks repo or in the "Custom SQLite driver" docs[1]).

[0]: https://github.com/pocketbase/benchmarks

[1]: https://pocketbase.io/docs/go-overview/#custom-sqlite-driver
randomwebdev
·2 anni fa·discuss
Hi, PocketBase author here.

Keep in mind that PocketBase do a lot more than just executing a raw DB query. We perform data validation, normalization, serialization, enriching, auto fail-retry to handle additional SQLITE_BUSY errors, etc. All of this comes with some cost and will always have an effect when doing microbenchmarks like this.

The performance would also depend on what version of PocketBase did you try (before or after v0.10), whether you used CGO or the pure Go driver, etc.

For a benchmark closer to "real world" scenarios tested on various servers you can check the results from https://github.com/pocketbase/benchmarks.

There is definitely room for improvements (I haven't done any detailed profiling yet) but the current performance is "good enough" for the purposes the applications PocketBase is intended for (I've shared some numbers regarding a PocketBase app on production in https://github.com/pocketbase/pocketbase/discussions/4254).

Hope the above helps.
randomwebdev
·3 anni fa·discuss
I'm sorry but that doesn't make sense to me (especially your last sentence regarding TypeScript).

During development vite has HMR and you don't need to run build after every change. This is no different when using SSR.

But I don't want to further argue. If you think that SPA is not suitable for your use case, that's ok.
randomwebdev
·3 anni fa·discuss
I don't understand your concern with it and why this is a problem.

I haven't personally noticed the vite/esbuild memory consumption, but I also run build only once at the end before deployment or generating the prod artifacts.
randomwebdev
·3 anni fa·discuss
Why? I think most modern bundlers and spa routers supports code splitting out of the box by just using dynamic imports, aka: `const myComponent = await import("/path/to/component")`
randomwebdev
·3 anni fa·discuss
It is really a cool project. We are using it as a default driver in PocketBase and although it is not a "drop-in" replacement of the CGO alternative `mattn/go-sqlite3` (different dsn format, some differences in the error messages, etc.), with a small abstraction it works fine for most cases and greatly simplify cross compilation.

Performance wise I haven't done intensive benchmark tests yet, but from my local experiments last year it performed ~1.5-2x slower than the CGO version for some queries (it is especially noticeable with LIKE expressions on large string data), but as mentioned previously, for most use cases it is already good enough.

Here are the most recent benchmarks I could find (I think from one of the maintainers of the lib) comparing the CGO version and the pure Go port - https://docs.google.com/spreadsheets/d/1YOP1D_ZhuR-ednQhTH6S...