go-orm-benchmarks icon indicating copy to clipboard operation
go-orm-benchmarks copied to clipboard

Benchmark against other DBMS

Open gandaldf opened this issue 3 years ago β€’ 7 comments
trafficstars

It would be great to have benchmarks for MSSQL, MySql and SQLite3 too!

gandaldf avatar Apr 25 '22 09:04 gandaldf

We may add MySQL and sqlite. I think don't need mssql

efectn avatar Apr 25 '22 11:04 efectn

πŸ˜… It's the one I use most... and I think it used often by others, maybe not as much as Postgres or MySQL but something to care about.

gandaldf avatar Apr 25 '22 12:04 gandaldf

πŸ˜… It's the one I use most... and I think it used often by others, maybe not as much as Postgres or MySQL but something to care about.

I don't have any experience with Microsoft stack. If sameone do it, why not

efectn avatar Apr 25 '22 12:04 efectn

Ok! If you set the code for MySQL and SQLite I will try to expand it for MSSQL.

gandaldf avatar Apr 26 '22 10:04 gandaldf

Ok! If you set the code for MySQL and SQLite I will try to expand it for MSSQL.

I'll think how to do it shortly. If you have an idea, dont forget sharing ☺️

efectn avatar Apr 26 '22 10:04 efectn

The first thing that comes to my mind is to rename every current bench file with _pg suffix, make copies of them adding _mysql, _sqlite, _mssql. For every new copy then adapt the code inside to target a new DBMS; for example:

st := NewSuite("beego") to: st := NewSuite("beego_pg") st := NewSuite("beego_mysql") st := NewSuite("beego_sqlite") st := NewSuite("beego_mssql")

and obviously rename all its functions; for example:

BeegoOrmInsert to: BeegoOrmInsertPg BeegoOrmInsertMysql BeegoOrmInsertSqlite BeegoOrmInsertMssql and so on...

I know it's pretty brutal; in an ideal world you should just need to adapt the init() func to target a different DBMS, but in the real worl every ORM handles queries in different way for each DBMS (I'm thinking to raw, bun or dbr). Some ORM maybe couldn't support every DBMS we are testing, so at the end of the day you need a place where handle every specific case. This is just my first thought. any better idea is welcome!

gandaldf avatar Apr 26 '22 11:04 gandaldf

The first thing that comes to my mind is to rename every current bench file with _pg suffix, make copies of them adding _mysql, _sqlite, _mssql. For every new copy then adapt the code inside to target a new DBMS; for example:

st := NewSuite("beego") to: st := NewSuite("beego_pg") st := NewSuite("beego_mysql") st := NewSuite("beego_sqlite") st := NewSuite("beego_mssql")

and obviously rename all its functions; for example:

BeegoOrmInsert to: BeegoOrmInsertPg BeegoOrmInsertMysql BeegoOrmInsertSqlite BeegoOrmInsertMssql and so on...

I know it's pretty brutal; in an ideal world you should just need to adapt the init() func to target a different DBMS, but in the real worl every ORM handles queries in different way for each DBMS (I'm thinking to raw, bun or dbr). Some ORM maybe couldn't support every DBMS we are testing, so at the end of the day you need a place where handle every specific case. This is just my first thought. any better idea is welcome!

Thanks. I'll check it on next 2 weeks.

efectn avatar May 02 '22 04:05 efectn